import { createOrder } from "@/Api/payment";
const state = {
  curOrder: {},
};
const mutations = {
    ADD_CURORDER(state,value){
        state.curOrder=value
    }
};
const actions = {
  async createOrder({ commit }, data) {
    let result = await createOrder(data);

    console.log(result);
    if (result.data.status == 200) {
      data.orderId = result.data.orderId;
      commit('ADD_CURORDER',data)
      return "success";
    } else return "eror";
  },
};
const getters = {};
export default {
  state,
  mutations,
  actions,
  getters,
};
